package com.amumu.drama.admin.modules.game.controller;

import com.amumu.drama.common.base.api.CommonResult;
import com.amumu.drama.common.modules.fulu.dto.resp.FuluProductResp;
import com.amumu.drama.common.modules.fulu.manager.FuLuManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 福禄商品SKU管理器
 * Created by macro on 2018/4/27.
 */
@Controller
@Api(tags = "福禄商品管理")
@RequestMapping("/fuluProduct")
public class FuLuPmsProductController {
    @Autowired
    private FuLuManager fuLuManager;

    @ApiOperation("微丸子-获取福禄商品信息")
    @RequestMapping(value = "/queryProductList", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<List<FuluProductResp>> getList() {
        return CommonResult.success(fuLuManager.queryProductList());
    }


    @ApiOperation("微丸子-根据模板ID返回福禄商品模板信息")
    @RequestMapping(value ="/getProductTemplate/{templateId}",method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<String> getProductTemplate(@PathVariable String templateId){
        return CommonResult.success(fuLuManager.getProductTemplate(templateId));
    }
}
